package qf.dao.daoImpl;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import qf.dao.TypeDao;
import qf.pojo.Type;
import qf.utils.DBUtil;

import java.sql.SQLException;
import java.util.List;

/**
 * @author 86198
 * @version V1.0
 * @Project Java_qf
 * @Package qf.dao.daoImpl
 * @Description:
 * @Date 2022/5/24 16:03
 */
public class TypeDaoImpl implements TypeDao {
    private QueryRunner qr = new QueryRunner(DBUtil.getDateSource());
    @Override
    public List<Type> findGoods() {
        String sql = "select * from tb_goods_type";
        try {
            List<Type> Goods = qr.query(sql, new BeanListHandler<Type>(Type.class));
            return Goods;
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }


}
